package com.study.controller;

import lombok.Data;

/**
 * @author : wilbur.yuan
 * @date : 2018-11-20
 */
@Data
public class Result<T> {

    private int retCode;

    private String retMsg;

    private T data;

    public static <T> Result success(T data){
        Result result = new Result();
        result.setData(data);
        result.setRetCode(0);
        return result;
    }

    public static Result error(int retCode, String retMsg){
        Result result = new Result();
        result.setRetCode(retCode);
        result.setRetMsg(retMsg);
        return result;
    }
}
